"""
声明动物类
"""
class Animal:
    # 属性-特征
    def __init__(self,name,age,sex):
        self.name = name
        self.age = age
        self.sex = sex
    # 行为-动作 函数
    def eat(self,food):
        print(f"eat{food}")

    def drink(self,dx):
        print(f"drink{dx}")


# 定义类的对象来使用代码
dog = Animal("小黄",20,"公")
print(dog.name,dog.age,dog.sex,sep=" ")

dog.eat("肉")
dog.drink("可乐")

cat = Animal("可乐",2,"母")
print(cat.name,cat.age,cat.sex)

fish = Animal()
print(fish.name)





